<include file="Zeninc:header" title="PDM密码管理系统"/>

    <script src="{:PDM_CONTENT_URL}third-party/bootstrap/plugins/typeahead/bootstrap-typeahead.js" type="text/javascript"></script>
	
	
	
	
    <div class="container">

      <div class="pdm-search">
      <form action="{:pdm_ux('index')}" method="">
        {:W('URI')}
        <h3>搜索</h3>
        <div class="form-group">
			<input type="text" name="wd" data-provide="typeahead" class="form-control input-lg" id="wd" autocomplete="off" placeholder="输入关键词进行检索" value="{$Think.get.wd}">
			<p class="hidden"><input type="submit" value="搜索"></p>
		  </div>
	</form>
      </div>
	

<div class="pdm-search">
 <table class="table table-striped table-bordered">
      <thead>
        <tr>
          <th>标题</th>
          <th>添加日期</th>
        </tr>
      </thead>
      <tbody>
      <volist id="vo" name="list">
      <php>$_pid=pdm_code($vo['id']);</php>
        <tr>
          <td><a href="{:pdm_ux('Password/view?id=')}{$_pid}">{$vo.title}</a></td>
          <td>{$vo.add_time|pdm_time_format}</td>
        </tr>
       </volist>
      </tbody>
    </table>
</div>




	  
	</div>
<script>

	var _api="{:pdm_ux('Password/search')}";

  

  $('#wd').typeahead({
        ajax: {
            url: _api,
            timeout: 300,
            method: 'get',
            triggerLength: 1
        },
        itemSelected: function (item, val, text) {
          console.log(item);
          $('.alert').show().html('You selected <strong>' + val + '</strong>: <strong>' + text + '</strong>');
        }
    });

	
	</script>
<include file="Zeninc:footer"/>